const vscode = require('vscode');

function activate(context) {
    let disposable = vscode.commands.registerCommand('extension.addBlockComment', function () {
        const editor = vscode.window.activeTextEditor;
        if (editor) {
            const document = editor.document;
            const selection = editor.selection;

            // 获取选中的文本
            const selectedText = document.getText(selection);
            
            // 创建多行注释
            const commentedText = `/*\n${selectedText}\n*/`;

            editor.edit(editBuilder => {
                editBuilder.replace(selection, commentedText);
            });
        }
    });

    context.subscriptions.push(disposable);
}

function deactivate() {}

module.exports = {
    activate,
    deactivate
};
